/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Util;

import coms.dto.Heading;
import coms.dto.Section;
import java.util.List;

/**
 *
 * @author Atul
 */
public class GenericReviewStrategy implements ReviewStrategy{

    @Override
    public int calulatePoint(List<Section> sections) {
        int total = 0;
        for (Section section : sections) {
            List<Heading> headings = section.getHeadings();
            for (Heading heading : headings) {
               int rating =  heading.getRating();
               if(rating>0)
               total += rating;
            }
        }
        return total;
    }
    
}
